﻿@{
    Layout = null;
}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>首页</title>
    @Styles.Render("~/Content/admin/style/css")
    @Scripts.Render("~/bundles/jquery")
    @Scripts.Render("~/bundles/jqueryval")
    @Scripts.Render("~/bundles/admin/js")
    @Scripts.Render("~/Scripts/admin/DateInput/WdatePicker.js")
    @Styles.Render("~/Content/autocomplete/jquery-ui.css")
</head>

<body>
    <!-- headerStart -->
    <div class="header">
        <div class="header-in clearfix">
            <div class="fl">
                <a href="http://www.cnki.net" class="logo fl">
                    <img src="~/Content/admin/images/logo.png" alt="" /></a>
                <span class="header-line fl"></span>
                <h1 class='fl'>信息资源建设与管理平台后台系统</h1>
            </div>
            <div class="fr">
                <div class="header-r">
                    @{ 
                        bool anonymousControlFlag = CNKI.TPI.Web.Base.ConfigHelper.IsAnonymousControlEnabled();
                        string anonymousUsername = CNKI.TPI.Web.Base.ConfigHelper.GetAnonymousAccount();
                        string currentUsername = "";
                        if (CNKI.TPI.Web.Base.SessionHelper.IsUserInfoExsit())
                        {
                            currentUsername = CNKI.TPI.Web.Base.SessionHelper.GetUserInfo().UserCode;
                        }
                    }

                    @if (CNKI.TPI.Web.Base.SessionHelper.IsUserInfoExsit() && ((anonymousControlFlag && !anonymousUsername.Equals(currentUsername)) || !anonymousControlFlag))
                    {
                        CNKI.TPI.Web.Search.Model.LoginUserInfo userInfo = CNKI.TPI.Web.Base.SessionHelper.GetUserInfo();
                        string username = string.IsNullOrEmpty(userInfo.UserName) ? userInfo.UserCode : userInfo.UserName;
@*<img class='inline-block vam mr10' src="~/Content/admin/images/tx.png" alt="" />*@
                        @Html.Raw(@username + " 您好！  ")
                        @Html.ActionLink("返回首页", "Index", "Home", routeValues: null, htmlAttributes: new { id = "loginLink" })
                        <a class='ml20' href="javascript:document.getElementById('logoutForm').submit()">注销</a>
                        using (Html.BeginForm("LogOff", "Account", FormMethod.Post, new { id = "logoutForm" }))
                        {
                        @Html.AntiForgeryToken()
                        }

                    }
                    else
                    {
                        <div>
                            @*@Html.ActionLink("注册", "Register", "Account", routeValues: null, htmlAttributes: new { id = "registerLink" })*@
                            @Html.ActionLink("登录", "Login", "Home", routeValues: null, htmlAttributes: new { id = "loginLink" })
                        </div>
                    }

                </div>
            </div>
        </div>
    </div>
    <!-- headerEnd -->

    <!-- conStart -->
    @RenderBody()
    <!-- conEnd -->

    <!-- footerStart -->
    <div class="footer tc posa">同方知网数字技术股份有限公司 </div>
    <!-- footerEnd -->

</body>
</html>
